3.20 \(\int \frac{1}{a+b \cos ^2(x)} \, dx\)

Optimal. Leaf size=30 \[ -\frac{\tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{a+b}} \]

[Out]

-(ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]]/(Sqrt[a]*Sqrt[a + b]))

________________________________________________________________________________________

Rubi [A]  time = 0.0185856, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3181, 205} \[ -\frac{\tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{a+b}} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Cos[x]^2)^(-1),x]

[Out]

-(ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]]/(Sqrt[a]*Sqrt[a + b]))

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{1}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )\\ &=-\frac{\tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{a+b}}\\ \end{align*}

Mathematica [A]  time = 0.0567149, size = 29, normalized size = 0.97 \[ \frac{\tan ^{-1}\left (\frac{\sqrt{a} \tan (x)}{\sqrt{a+b}}\right )}{\sqrt{a} \sqrt{a+b}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cos[x]^2)^(-1),x]

[Out]

ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]]/(Sqrt[a]*Sqrt[a + b])

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 21, normalized size = 0.7 \begin{align*}{\arctan \left ({a\tan \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*cos(x)^2),x)

[Out]

1/((a+b)*a)^(1/2)*arctan(a*tan(x)/((a+b)*a)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.80338, size = 406, normalized size = 13.53 \begin{align*} \left [-\frac{\sqrt{-a^{2} - a b} \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \,{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt{-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right )}{4 \,{\left (a^{2} + a b\right )}}, -\frac{\arctan \left (\frac{{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt{a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right )}{2 \, \sqrt{a^{2} + a b}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[-1/4*sqrt(-a^2 - a*b)*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 3*a*b)*cos(x)^2 + 4*((2*a + b)*cos(x)^
3 - a*cos(x))*sqrt(-a^2 - a*b)*sin(x) + a^2)/(b^2*cos(x)^4 + 2*a*b*cos(x)^2 + a^2))/(a^2 + a*b), -1/2*arctan(1
/2*((2*a + b)*cos(x)^2 - a)/(sqrt(a^2 + a*b)*cos(x)*sin(x)))/sqrt(a^2 + a*b)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cos(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.13554, size = 50, normalized size = 1.67 \begin{align*} \frac{\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )}{\sqrt{a^{2} + a b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

(pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))/sqrt(a^2 + a*b)